<template>
	<el-container>
		<el-main>
			<el-divider content-position="center">前端VUE代码</el-divider>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="管理页面">
						<p class="cmm-wrapper">{{ form.vueTemplateManage }}</p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="编辑页面">
						<p class="cmm-wrapper">{{ form.vueTemplateSave }}</p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="详情页面">
						<p class="cmm-wrapper">{{ form.vueTemplateDetails }}</p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-divider content-position="center">后端JAVA代码</el-divider>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="Controller文件 Get">
						<p class="cmm-wrapper" v-html="form.controllerTemplateGet"></p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="Controller文件 Set">
						<p class="cmm-wrapper" v-html="form.controllerTemplateSet"></p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="Service文件">
						<p class="cmm-wrapper" v-html="form.serviceTemplate"></p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="Mapper文件">
						<p class="cmm-wrapper" v-html="form.mapperTemplate"></p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
			<el-divider content-position="center">MyBatis XML Sql 代码</el-divider>
			<el-row :gutter="24">
				<el-col :lg="20">
					<el-form-item label="MyBatis Xml 文件">
						<p class="cmm-wrapper">{{form.mapperXmlTemplate}}</p>
					</el-form-item>
				</el-col>
				<el-col :lg="4">
				</el-col>
			</el-row>
		</el-main>
	</el-container>
</template>

<script>
export default {
	name: 'System Gen Template',
	data() {
		return {
			form:
				{
					vueTemplateManage: '',
					vueTemplateSave: '',
					vueTemplateDetails: '',
					vueTemplateApi: '',
					serviceTemplate: '',
					mapperTemplate: '',
					beanTemplate: '',
					mapperXmlTemplate: '',
					controllerTemplateGet:'',
					controllerTemplateSet:'',
				}
		}
	},
	mounted() {
		this.getSysGenTemplate();
	},
	methods: {
		async getSysGenTemplate() {
			var res = await this.$API.gen.sysGenTemplate.getSysGenTemplate.get();
			if (res.code == 200) {
				this.form = res.data;
			} else {
				this.$alert(res.message, "提示", {type: 'error'})
			}
		}
	}
}
</script>

<style scoped>
	.cmm-wrapper{
		white-space: pre-wrap;
		line-height: 20px;
		color: #000032;
		font-size: 14px;
	}
</style>
